<?php 
//PDF
/**
 * URL - http://html2pdf.fr/en/example
 * HTML2PDF Librairy - example
 *
 * HTML => PDF convertor
 * distributed under the LGPL License
 *
 * @author      Laurent MINGUET <webmaster@html2pdf.fr>
 *
 * isset($_GET['vuehtml']) is not mandatory
 * it allow to display the result in the HTML format
 */
	
    // get the HTML
    /*  ob_start();
	$page = "print_re.php";
    include(dirname(__FILE__). '/' . $page);
    $content = ob_get_clean();
	$name = $root_dir.'/reimbursement' . time() . '.pdf';
    //convert in PDF
    require_once(dirname(__FILE__).'/classes/html2pdf_v4/html2pdf.class.php');
    try
    {
        $html2pdf = new HTML2PDF('P', 'A4', 'fr');
     //$html2pdf->setModeDebug();
        $html2pdf->setDefaultFont('helvetica ');
        $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
        $html2pdf->Output($name ,'F');
    }
    catch(HTML2PDF_exception $e) {
        echo $e;
        exit;
    } 
	
	//$file_to_zip[$i] = trim($project).'_business_process_questions.pdf';
	$directoryToZip="reimbursement"; // This will zip all the file(s) in this present working directory
	$outputDir="reimbursement"; //Replace "/" with the name of the desired output directory.
	$zipName='reimbursement_'.time().'.zip';

	$dh_filename = $zipName;
	$dh_module = 'reimbursement';
	

	$createZipFile=new CreateZipFile;

	//de toZip a directory and all its files/subdirectories
	$createZipFile->zipDirectory($directoryToZip,$outputDir);

	$fd=fopen($zipName, "wb");
	$out=fwrite($fd,$createZipFile->getZippedfile());
	fclose($fd);
	$createZipFile->forceDownload($zipName);
	@unlink($zipName);  */ 
	
	ob_start();
	$date = $_GET['date'];
	$alias = $_GET['alias'];
	//$page = "print_re.php";
	$page = "sample_reim.php";
    include(dirname(__FILE__).'/' . $page);
	$content = ob_get_clean();

	$name = 'reimbursement' . time() . '.pdf';

    require_once('classes/html2pdf_v4/html2pdf.class.php');
    $html2pdf = new HTML2PDF('P','A4','fr');
	$html2pdf->setDefaultFont('helvetica');
    $html2pdf->WriteHTML($content);
    $html2pdf->Output('reimmbursement.pdf');  
	?>